home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / mathstud.zip / RANK.M < prev    next >
Text File  |  1993-03-23  |  248b  |  13 lines

  1. function rv = rank(x,tol)
  2. %rv=rank(x,tol)
  3. %computes the rank of the matrix x (using SVD)
  4.  
  5. %       S.Halevy 7/31/92
  6. %       Copyright (c) 1992 by the MathWizards
  7.  
  8. s = svd(x);
  9. if nargin<2
  10.    tol=max(size(x))*s(1)*eps; 
  11. end
  12. rv=sum(s>tol);
  13.